<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'新建文档','search'=>'N'))}

	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
		<input type="hidden" id="ajax" name="ajax" value="0">
		
		<input type="hidden" id="folder" name="folder" value="{$folder}">
		<input type="hidden" id="fid" name="fid" value="{$folder}">
		<input type="hidden" id="opmode" name="opmode" value="add">

		<div class="form-group">
			<label class="col-sm-2 control-label" for="name">文件名：</label>
			<div class="col-sm-10">
				<input class="form-control" type="text" id="name" name="name" value=""  check="require" msg="请输入文件名">
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 control-label" for="name">附件：</label>
			<div class="col-sm-10">
				{:W('FileUpload/add')}
			</div>
		</div>
		<div class="form-group">
			<div class="col-xs-12">
				<textarea class="editor" id="content" name="content" style="width:100%;height:300px;" check="require" msg="请输入内容"></textarea>
			</div>
		</div>
		<div class="action">
			<input class="btn btn-sm btn-primary" type="button" value="保存" onclick="save();">
			<input class="btn btn-sm btn-default" type="button" value="取消" onclick="go_return_url();">
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
			window.onbeforeunload = null;
			sendForm("form_data", "{:U('save')}");
		}
	</script>
</block>